//
//  QRCodeController.swift
//  swift-微博
//
//  Created by chenrin on 2016/12/16.
//  Copyright © 2016年 zhuoheng. All rights reserved.
//

import UIKit

class QRCodeController: UIViewController {

   
    //View的高度约束
    @IBOutlet weak var containerHeightCons: NSLayoutConstraint!
 
    //底部TabBar
    @IBOutlet weak var customTabBar: UITabBar!
    
   
    override func viewDidLoad() {
        super.viewDidLoad()
       //1.设置底部TabBar默认选中第0个
        customTabBar.selectedItem = customTabBar.items?[0]
        customTabBar.delegate = self
        
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
       
    }
    }

// MARK:- 回调方法
extension QRCodeController:UITabBarDelegate{
    @IBAction func closeBtnClick(_ sender: UIBarButtonItem) {
        dismiss(animated: true, completion: nil)
    }
    
    @IBAction func photoClick(_ sender: Any) {
    }
    
    // MARK:- TabBarDelegate
    func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
        
        //修改高度
        if item.tag == 1 {
            print("二维码")
            self.containerHeightCons.constant = 300
        }else{
            self.containerHeightCons.constant = 150
            print("条形码")
        }
       
    }
    
}





